package com.payment.system.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.payment.common.support.Convert;
import com.payment.system.domain.MerchantParent;
import com.payment.system.mapper.MerchantParentMapper;
import com.payment.system.service.IMerchantParentService;

/**
 * 商户上级关系 服务层实现
 * 
 * @author payment
 * @date 2019-06-20
 */
@Service
public class MerchantParentServiceImpl implements IMerchantParentService 
{
	@Autowired
	private MerchantParentMapper merchantParentMapper;

	/**
     * 查询商户上级关系信息
     * 
     * @param merchantPhone 商户上级关系ID
     * @return 商户上级关系信息
     */
    @Override
	public MerchantParent selectMerchantParentById(String merchantPhone)
	{
	    return merchantParentMapper.selectMerchantParentById(merchantPhone);
	}
	
	/**
     * 查询商户上级关系列表
     * 
     * @param merchantParent 商户上级关系信息
     * @return 商户上级关系集合
     */
	@Override
	public List<MerchantParent> selectMerchantParentList(MerchantParent merchantParent)
	{
	    return merchantParentMapper.selectMerchantParentList(merchantParent);
	}
	
    /**
     * 新增商户上级关系
     * 
     * @param merchantParent 商户上级关系信息
     * @return 结果
     */
	@Override
	public int insertMerchantParent(MerchantParent merchantParent)
	{
	    return merchantParentMapper.insertMerchantParent(merchantParent);
	}
	
	/**
     * 修改商户上级关系
     * 
     * @param merchantParent 商户上级关系信息
     * @return 结果
     */
	@Override
	public int updateMerchantParent(MerchantParent merchantParent)
	{
	    return merchantParentMapper.updateMerchantParent(merchantParent);
	}

	/**
     * 删除商户上级关系对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteMerchantParentByIds(String ids)
	{
		return merchantParentMapper.deleteMerchantParentByIds(Convert.toStrArray(ids));
	}



}
